package de.koller.pulsar.scene.particle;

import de.koller.oceanFramework.math.RVec2;

public class SquareParticle {
	
	public final RVec2 position = new RVec2();
	public final RVec2 size = new RVec2();
	private int color = 0xff_ffffff;

	public SquareParticle() {
	
	}
	
	public void setColor( int color ) {
		this.color = color;
	}
	
	public boolean isInBounds( int x, int y ) {
		if( x < position.x - 1 ) return false;
		if( y < position.y - 1 ) return false;
		if( x > position.x + size.x + 1 ) return false;
		if( y > position.y + size.y + 1 ) return false;
		return true;
	}
	
	public PixelValue getPixel( int x, int y ) {
		if( !isInBounds( x, y ) )
			return new PixelValue( 0, 0 );
		
		float occ = 0;
		
		
		return new PixelValue( 1, color );
	}
	
	public class PixelValue {
		
		public final float occultation;
		public final int color;
		
		private PixelValue( float occultation, int color ) {
			this.occultation = occultation;
			this.color = color;
		}
		
	}
}
